const express = require("express");
const router = express.Router();

router.post("/", async (req, res) => {
  const { name, icon, path, svg, title, sort, father } = req.body;
  await req.db.connection.execute(
    "INSERT INTO menus (name, icon, path, svg, title, sort, father) VALUES (?, ?, ?, ?, ?, ?, ?)",
    [name, icon, path, svg, title, sort, father]
  );
  res.send({
    success: true,
    message: "菜单添加成功",
  });
});
module.exports = router;
